<!--#layout("/common/layout.html",{"jsBase":"/js/cms/siteFunds/"}){ -->
<div class="layui-tab" lay-filter="test">
    <ul class="layui-tab-title">
        <li class="layui-this">待办任务</li>
        <li>已办任务</li>

    </ul>
    <div class="layui-tab-content">
        <layui:searchForm formId="searchForm" condition="${search}">
        </layui:searchForm>
        <div class="layui-tab-item layui-show">
            <div class="layui-btn-group">
                <layui:accessButton function="siteFunds.check"  action="auditor">审核</layui:accessButton>
            </div>
            <table id="siteFundsTable" lay-filter="siteFundsTable"></table>
        </div>
        <div class="layui-tab-item">
            <div class="layui-btn-group">
                <layui:accessButton function="siteFunds.check" action="find">查看</layui:accessButton>
                <layui:accessButton function="siteFunds.check" action="process">审核流程</layui:accessButton>
            </div>
            <table id="BusinessProcessTable" lay-filter="BusinessProcessTable"></table>
        </div>
    </div>
</div>
<!--#} -->
<script>
    layui.use(['layer', 'form', 'element'], function () {
    });
layui.use(['chushenindex'], function(){
    var index = layui.chushenindex
    index.init();

    var form = layui.form;
    form.on('select(workstationName)', function (data) {
        $.ajax({
            url: "/cms/siteFunds/findSite.do",
            data:{id:data.value},
            dataType: 'json',
            type: 'post',
            success: function (data) {
                $("#approvalNumber").val(data.approvalNumber);
                $("#timeConstruction").val(new Date(data.timeConstruction).format("yyyy-MM-dd"));
            }
        })
        if(data.value==""){
            $("#approvalNumber").val("");
            $("#timeConstruction").val("");
        }
    });

    form.on('select(fundingProjects)', function (data) {
        var value = data.value;
        if (value == 1 || value == 2) {
            $("#declarationAmount").val(150000.00);
        } else if (value == 3 || value == 4){
            $("#declarationAmount").val(100000.00);
        }
    });
});

    layui.use(['element', 'table'], function(){
        var element = layui.element;
        var table = layui.table;
        element.on('tab(test)', function (data) {
            if(data.index ==0) {
                table.reload('siteFundsTable');
            }
            else if(data.index == 1) {
                table.reload('BusinessProcessTable');
            }
        });
    });

    layui.use(['business'], function(){
        var index = layui.business
        index.init();
    });


</script>
